import request from '@/utils/request';
// 修改店铺信息
export function updateUser(data) {
  return request({
    url: '/ShopRest/update',
    method: 'post',
    data
  });
}

export function getTIMToken(data) {
  return request({
    url: '/ShopRest/getsign',
    method: 'post',
    data
  });
}

/**
 * 创建相册
 *{
   name：'相册名字'，
   shopId：'店铺id'，
   albumDetails: [{
      name: '',
      image: '',
      shopId: '',
   }]
  }
 */
export function createAlbum(data) {
  return request({
    url: '/ShopRest/addAlbum',
    method: 'post',
    data
  });
}
/**
 * 编辑相册
 *{
   name： '相册名字'，
   shopId： '店铺id'，
   id: '',
   albumDetails: [{
     name: '',
     image: '',
     shopId: '',
     albumId: ''
   }]
 }
 */
export function updateAlbum(data) {
  return request({
    url: '/ShopRest/updateAlbum',
    method: 'post',
    data
  });
}
/**
 * 删除相册
 * {id:'相册id'}
 */
export function deleteAlbum(data) {
  return request({
    url: '/ShopRest/deleteAlbum',
    method: 'post',
    data
  });
}
/**
 * 删除图片
 * {id:'图片id'} // 多图使用','分隔
 */
export function deletePic(data) {
  return request({
    url: '/ShopRest/deleteAlbumDetails',
    method: 'post',
    data
  });
}
/**
 * 查看相册列表
 * {shopId:''}
 */
export function getAlbumList(data) {
  return request({
    url: '/ShopRest/getAlbum',
    method: 'post',
    data
  });
}
/**
 * 查看相册详情
 * {id:'相册id'}
 */
export function getAlbumDetails(data) {
  return request({
    url: '/ShopRest/getAlbumDetails',
    method: 'post',
    data
  });
}
/**
 * 移动图片到其他相册
 *{
   "albumDetails": [{
       "id": "1",
       "albumId": "123"
     }
   ]
 }
 */
export function movePicToAlbum(data) {
  return request({
    url: '/ShopRest/batchAlbumDetails',
    method: 'post',
    data
  });
}

